package cn.iocoder.yudao.module.reading.controller.app.auth.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Builder;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;

/**
 * 绘本阅读 APP - 微信登录 Request VO
 *
 * @author 李晨
 */
@Schema(description = "绘本阅读 APP - 微信登录 Request VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ReadingWxLoginReqVO {

    @Schema(description = "微信授权码", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx_code_123")
    @NotEmpty(message = "微信授权码不能为空")
    @Size(max = 128, message = "微信授权码长度不能超过128个字符")
    private String code;

    @Schema(description = "微信用户信息")
    private WxUserInfo userInfo;

    @Schema(description = "设备信息")
    private String deviceInfo;

    @Schema(description = "微信用户信息")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class WxUserInfo {
        @Schema(description = "微信昵称", example = "微信用户")
        @Size(max = 50, message = "昵称长度不能超过50个字符")
        private String nickName;

        @Schema(description = "微信头像", example = "https://wx.qlogo.cn/...")
        @Size(max = 500, message = "头像URL长度不能超过500个字符")
        private String avatarUrl;

        @Schema(description = "性别", example = "1")
        private Integer gender;

        @Schema(description = "国家", example = "中国")
        @Size(max = 50, message = "国家名称长度不能超过50个字符")
        private String country;

        @Schema(description = "省份", example = "广东")
        @Size(max = 50, message = "省份名称长度不能超过50个字符")
        private String province;

        @Schema(description = "城市", example = "深圳")
        @Size(max = 50, message = "城市名称长度不能超过50个字符")
        private String city;

        @Schema(description = "语言", example = "zh_CN")
        @Size(max = 10, message = "语言代码长度不能超过10个字符")
        private String language;
    }

}
